package com.lingdian.resume.service.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lingdian.resume.bean.ResumeInfo;
import com.lingdian.resume.repository.ResumeInfoRepository;
import com.lingdian.resume.service.ResumeInfoService;

@Service("resumeInfoService")
public class ResumeInfoServiceImpl implements ResumeInfoService{
	
	@Autowired
	private ResumeInfoRepository resumeInfoRepository;
	@PersistenceContext
	private EntityManager entityManager;
	
	@Override
	public void saveResumeInfoFromHtml(String html,String htmlId) {
		ResumeInfo exist = resumeInfoRepository.findByhtmlId(htmlId);
		if(exist==null){
			ResumeInfo resumeInfo = new ResumeInfo();
			resumeInfo.setHtmlId(htmlId);
			resumeInfo.setText(html);
			resumeInfoRepository.save(resumeInfo);
		}
	}
	

}
